import http from '../request';
const apibase = '/api/SemiMGoodsDistribute';

//查询数据
var getSemiMGoodsDistributeList = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/GetSemiMGoodsDistributeList`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

//新增数据
var insSemiMGoodsDistribute = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/InsSemiMGoodsDistribute`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

//修改数据
var updSemiMGoodsDistribute = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/UpdSemiMGoodsDistribute`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
//下发、反下发数据
var issueSemiMGoodsDistribute = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/IssueSemiMGoodsDistribute`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

//删除数据
var delSemiMGoodsDistribute = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/DelSemiMGoodsDistribute`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};

//批量删除数据
var delSemiMGoodsDistributeList = function (data) {
  return new Promise ((resolve, reject) => {
    http
      .post (apibase + `/DelSemiMGoodsDistributeList`, data)
      .then (res => {
        resolve (res);
      })
      .catch (error => {
        reject (error);
      });
  });
};
export {
  getSemiMGoodsDistributeList,
  insSemiMGoodsDistribute,
  updSemiMGoodsDistribute,
  issueSemiMGoodsDistribute,
  delSemiMGoodsDistribute,
  delSemiMGoodsDistributeList,
};
